package com.c8a.javaee2023.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * @Program: javaee2023
 * @Description:
 * @Author: c8a
 * @Email: 1912327276@qq.com
 * @Create: 2023-10-19 14:33
 **/


public class MyFilter01 implements Filter {
    /**
     * init()方法用于Filter的初始化
     */
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("执行了Filter的init()方法...");
    }

    /**
     * doFilter()方法用于Filter的拦截
     */
    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain) throws IOException, ServletException {
        System.out.println("执行了Filter的doFilter()方法...");
    }

    /**
     * destory()方法用于Filter的销毁
     */
    public void destroy() {
        System.out.println("执行了Filter的destroy()方法...");
    }


}
